'\"! tbl | mmdoc
'\"macro stdmacro
.\"
.\" Copyright (c) 2020 Ken McDonell.  All Rights Reserved.
.\"
.\" This program is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License as published by the
.\" Free Software Foundation; either version 2 of the License, or (at your
.\" option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful, but
.\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
.\" or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
.\" for more details.
.\"
.\"
.TH PMDERIVEDCONTROL 3 "" "Performance Co-Pilot"
.ds xM pmDerivedControl
.SH NAME
\f3pmGetDerivedControl\f1,
\f3pmSetDerivedControl\f1  \- get and set controls for derived metrics
.SH "C SYNOPSIS"
.ft 3
.ad l
.hy 0
#include <pcp/pmapi.h>
.sp
int pmGetDerivedControl(int \fIwhat\fP, int *\fIvaluep\fP);
.br
int pmSetDerivedControl(int \fIwhat\fP, int \fIvalue\fP);
.sp
cc ... \-lpcp
.hy
.ad
.ft 1
.SH DESCRIPTION
.de CR
.ie t \f(CR\\$1\fR\\$2
.el \fI\\$1\fR\\$2
..
These routines may be used to influence the behaviour of the
derived metric services that are activated for global derived metrics
using
.BR pmRegisterDerived (3),
.BR pmRegisterDerivedMetric (3)
and
.BR pmLoadDerivedConfig (3),
or per-context derived metrics using
.BR pmAddDerived (3)
and
.BR pmAddDerivedMetric (3).
.PP
The
.I what
argument selects a control, the
.I value
argument provides a value for
.B pmSetDerivedControl
and the
.I valuep
argument is used to return the value for
.BR pmGetDerivedControl .
.PP
The
.I what
argument has one of the following values:
.TP
.B PCP_DERIVED_GLOBAL_LIMIT
The maximum number of global derived metrics that may be defined.
The value \-1 indicates no limit.
.TP
.B PCP_DERIVED_CONTEXT_LIMIT
The maximum number of per-context derived metrics that may be defined.
The value \-1 indicates no limit.
.TP
.B PCP_DERIVED_DEBUG_SYNTAX
Debug diagnostics during parsing of derived metric expression.
The value 1 enables the diagnostics, the value 0 disables them.
.TP
.B PCP_DERIVED_DEBUG_SEMANTICS
Debug diagnostics for semantic checks
during the binding of metrics in the derived
metric expression to the available metrics in a new PMAPI context.
The value 1 enables the diagnostics, the value 0 disables them.
.TP
.B PCP_DERIVED_DEBUG_EVAL
Debug diagnostics when derived metrics are used in PMAPI operations
like
.BR pmFetch (3),
.BR pmGetChildren (3),
.BR pmGetChildrenStatus (3),
.BR pmLookupDesc (3),
.BR pmLookupName (3),
.BR pmNameAll (3),
.BR pmNameID (3)
and
.BR pmTraversePMNS (3).
.SH "RETURN VALUES"
Both routines return 0 on success, else a value less than 0
that can be decoded using
.BR pmErrStr (3).
.SH SEE ALSO
.BR PCPIntro (1),
.BR pmAddDerived (3),
.BR pmAddDerivedMetric (3),
.BR PMAPI (3),
.BR pmErrStr (3),
.BR pmLoadDerivedConfig (3),
.BR pmRegisterDerived (3),
.BR pmRegisterDerivedMetric (3)
and
.BR PMNS (5).

.\" control lines for scripts/man-spell
.\" +ok+ pmDerivedControl {from man generic page name}
